package org.codeart.juc.threadlocal;

public class ThreadLocalDemo {

    public static final ThreadLocal<Integer> t1 = new ThreadLocal<>();
    
    public static final ThreadLocal<Integer> t2 = new ThreadLocal<>();

    public static void main(String[] args) {
        t1.set(20);
        t2.set(100);
        new Thread(() -> {
            System.out.printf("t1: %s\n", t1.get());
            System.out.printf("t2: %s\n", t2.get());
        }).start();
        System.out.printf("main: %s\n", t1.get());
        System.out.printf("main: %s\n", t2.get());
    }

}
